home *** CD-ROM | disk | FTP | other *** search
/ IRIX Installation Tools & Overlays 2002 November / SGI IRIX Installation Tools & Overlays 2002 November - Disc 4.iso / dist / motif21_dev.idb / usr / Motif-2.1 / include / Xm / TextP.h.z / TextP.h
C/C++ Source or Header  |  2002-10-15  |  10KB  |  251 lines

  1. /* 
  2.  *  @OSF_COPYRIGHT@
  3.  *  COPYRIGHT NOTICE
  4.  *  Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
  5.  *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
  6.  *  the full copyright text.
  7. */ 
  8. /* 
  9.  * HISTORY
  10. */ 
  11. /* $XConsortium: TextP.h /main/16 1996/05/21 12:09:47 pascale $ */
  12. /* (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  13. /* (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  14. /*
  15.  *  (c) Copyright 1995 FUJITSU LIMITED
  16.  *  This is source code modified by FUJITSU LIMITED under the Joint
  17.  *  Development Agreement for the CDEnext PST.
  18.  *  This is unpublished proprietary source code of FUJITSU LIMITED
  19.  */
  20. #ifndef _XmTextP_h
  21. #define _XmTextP_h
  22.  
  23. #include <Xm/PrimitiveP.h>
  24. #include <Xm/TextOutP.h>
  25. #include <Xm/TextInP.h>
  26. #include <Xm/TransferT.h>
  27.  
  28. typedef struct _InputRec *Input;
  29. typedef struct _OutputRec *Output;
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #define NODELTA        LONG_MAX
  36.  
  37. #define TEXTWIDGETCLASS    "Text"    /* Resource class for the text widget. */
  38.  
  39. #define GetSrc(widget)  (((XmTextWidget) (widget))->text.source)
  40.  
  41. typedef struct {
  42.   XtPointer        extension;    /* Pointer to extension record */
  43.   
  44. #ifdef _SGIMOTIF
  45.   _SgClassExtension    _SG_vendorExtension;
  46. #endif
  47.  
  48. } XmTextClassPart;
  49.  
  50. typedef struct _XmTextClassRec {
  51.     CoreClassPart core_class;
  52.     XmPrimitiveClassPart primitive_class;
  53.     XmTextClassPart text_class;
  54. } XmTextClassRec;
  55.  
  56. externalref XmTextClassRec    xmTextClassRec;
  57.  
  58. typedef struct {
  59.     XmTextPosition start;    /* First position in this line. */
  60.     Boolean changed;        /* TRUE if something in this line changed. */
  61.     XmTextPosition changed_position; /* First position within the line that
  62.                     has changed, if any. */
  63.     Boolean past_end;        /* TRUE if this line is past the end of any */
  64.                 /* line actually on the screen. */
  65.     LineTableExtra extra;    /* Extra info the output module keeps. */
  66. } LineRec, *Line;
  67.  
  68. typedef struct _XmTextLineTableRec{
  69.     unsigned int start_pos:31;
  70.     unsigned int virt_line:1;
  71. } XmTextLineTableRec, *XmTextLineTable;
  72.  
  73. typedef struct {
  74.     XmTextPosition from, to;    /* Information on one range to repaint. */
  75. } RangeRec;
  76.  
  77. typedef struct {
  78.     Cardinal number;        /* Number of ranges defined. */
  79.     Cardinal maximum;        /* Number of ranges we have space for. */
  80.     RangeRec *range;        /* Pointer to array of ranges. */
  81. } Ranges;
  82.  
  83. #ifdef _SGIMOTIF
  84.  
  85. typedef struct __SG_XmTextExtPart {
  86.         
  87.     Pixel   selection_background; /* color of the selected text background */
  88.     Pixel    selection_foreground; /* color of the selected text foreground */
  89.     Pixel    error_background;/* color of the selected error text background */
  90.     Boolean  cursor_visible_on_focus; /* If true then cursor is visible
  91.                        only when is has the keyboard focus */
  92.     Boolean  post_motion_call;  /* If true then extra textVerifyCallback is made */
  93.   
  94. } _SG_XmTextExtPart;
  95.  
  96. typedef struct __SG_XmTextExt {
  97.  
  98.     _SgInstanceExtensionRec common;   /* Stuff all instance rec's have */
  99.     _SG_XmTextExtPart   rsrc;     /* Resources & instance var's */
  100.   
  101. } _SG_XmTextExtRec, *_SG_XmTextExt;
  102.  
  103.  
  104. #define _SG_TextPtr(w) ((_SG_XmTextExt)(((XmTextWidget)(w))->text._SG_vendorExtension))
  105.  
  106. #endif /* _SGIMOTIF */
  107.  
  108. /*
  109.  * The data for on-the-spot support.
  110.  */
  111. typedef struct _OnTheSpotDataTW {
  112.     XmTextPosition start;
  113.     XmTextPosition end;
  114.     XmTextPosition cursor;
  115.     XmTextPosition over_len;
  116.     XmTextPosition over_maxlen;
  117.     char *over_str;
  118.     int under_preedit;
  119.     Boolean under_verify_preedit;
  120.     Boolean verify_commit;
  121.     int pad;
  122. } OnTheSpotDataRecTW, *OnTheSpotDataTW;
  123.  
  124. #define PreStartTW(tw) ((tw)->text.onthespot->start)
  125. #define PreEndTW(tw) ((tw)->text.onthespot->end)
  126. #define PreCursorTW(tw) ((tw)->text.onthespot->cursor)
  127. #define PreOverLen(tw) ((tw)->text.onthespot->over_len)
  128. #define PreOverMaxLen(tw) ((tw)->text.onthespot->over_maxlen)
  129. #define PreOverStr(tw) ((tw)->text.onthespot->over_str)
  130. #define PreUnder(tw) ((tw)->text.onthespot->under_preedit)
  131. #define UnderVerifyPreedit(tw) ((tw)->text.onthespot->under_verify_preedit)
  132. #define VerifyCommitNeeded(tw) ((tw)->text.onthespot->verify_commit)
  133.  
  134.  
  135. /*
  136.  * Structure for main text info. 
  137.  */
  138.  
  139. typedef struct _XmTextPart {
  140.     XmTextSource source;           /* The source for this widget. */
  141.     XtCallbackList activate_callback;      /* command activate callback. */
  142.     XtCallbackList focus_callback;       /* Focus callback. */
  143.     XtCallbackList losing_focus_callback;  /* Losing focus callback. */
  144.     XtCallbackList value_changed_callback; /* Value changed callback. */
  145.     XtCallbackList modify_verify_callback; /* Verify value to change callback.*/
  146.     XtCallbackList wcs_modify_verify_callback; /* Verify value to change 
  147.                         * callback.*/
  148.     XtCallbackList motion_verify_callback; /* Insert cursor position 
  149.                           change callback. */
  150.     XtCallbackList gain_primary_callback; /* Gained ownership of Primary
  151.                          Selection */
  152.     XtCallbackList lose_primary_callback; /* Lost ownership of Primary
  153.                          Selection */
  154.     char *value;            /* The sring value in the widget */
  155.     wchar_t *wc_value;              /* Pointer for wchar_t value set by app */
  156.     Dimension margin_height;        /* height between text borders and text */
  157.     Dimension margin_width;         /* width between text borders and text */
  158.     Position cursor_position_x;     /* x pixel location of cursor */
  159.     OutputCreateProc output_create; /* Routine to create the output portion. */
  160.     InputCreateProc input_create;   /* Routine to create the input portion. */
  161.     /* The naming incongruity amongst the next three items was introduced */
  162.     /* due to a collision with top_position as used as a Form constraint; */
  163.     /* It has no other implications. */
  164.     XmTextPosition top_character;    /* First position to display. */
  165.     XmTextPosition bottom_position; /* Last position to display. */
  166.     XmTextPosition cursor_position; /* Location of the insertion point. */
  167.     int max_length;            /* Sets the max. length of string */
  168.     int edit_mode;            /* Sets the line editing mode
  169.                        (i.e. sinlge_line, multi_line, ...) */
  170.     Boolean auto_show_cursor_position; /* If true, automatically try to show
  171.                       the cursor position whenever it
  172.                       changes. */
  173.     Boolean editable;          /* Determines if text is editable */
  174.     Boolean verify_bell;       /* Determines if bell is sounded when verify
  175.                    *  callback returns doit - False
  176.                                    */
  177.     Boolean add_mode;          /* Determines the state of add moder */
  178.     Boolean traversed;            /* Flag used with losing focus verification to
  179.                      indicate a traversal key pressed event */
  180.     Boolean in_redisplay;      /* Whether currently in the redisplay proc. */
  181.     Boolean needs_redisplay;      /* Whether we need to repaint or refigure. */
  182.     Boolean in_refigure_lines;      /* Whether currently in refigurelines proc. */
  183.     Boolean needs_refigure_lines; /* Whether we need to refigure. */
  184.     Boolean in_setvalues;         /* Use to reduce unnecessary redisplays and
  185.                      geometry requsets */
  186.     Boolean in_resize;          /* Make sure there are no geometry requests
  187.                      while we are in resize procedure. */
  188.     Boolean in_expose;          /* Make sure there are no geometry requests
  189.                      while we are in expose procedure. */
  190.     Boolean highlight_changed;      /* Whether highlighting recently changed. */
  191.     Boolean pendingoff;         /* TRUE if we shouldn't do pending delete on
  192.                                    the current selection. */
  193.     char char_size;             /* number of bytes for storing a character */
  194.  
  195.     OnOrOff on_or_off;          /* used to halt unecessary motion verify
  196.                      callback calls during primary moves.*/
  197.     Output output;           /* The output portion. */
  198.     Input input;           /* The input portion. */
  199.  
  200.     XmTextPosition first_position; /* First legal position in the source. */
  201.     XmTextPosition last_position;  /* Last legal position in the source. */
  202.     XmTextPosition forget_past;       /* Forget all about positions past this. */
  203.     XmTextPosition force_display;  /* Force this position to be displayed. */
  204.     XmTextPosition new_top;       /* Desired new top position. */
  205.     XmTextPosition last_top_char;  /* unused - available. */
  206.     XmTextPosition dest_position;  /* Location of the destination point. */
  207.     int disable_depth;           /* How many levels of disable we've done. */
  208.  
  209.     int pending_scroll;        /* Number of lines we want to scroll. */
  210.     int total_lines;        /* Total number of lines in the text widget */
  211.     int top_line;        /* Line number of the top visible line */
  212.     int vsbar_scrolling;    /* scrolling using the vertical scrollbar */
  213.  
  214.     Cardinal number_lines;    /* Number of line table entries. */
  215.     Cardinal maximum_lines;    /* Maximum number of line table entries. */
  216.     Line line;            /* Pointer to array of line table entries. */
  217.  
  218.     Ranges repaint;        /* Info on the repaint ranges. */
  219.     _XmHighlightData highlight;    /* Info on the highlighting regions. */
  220.     _XmHighlightData old_highlight;/* Old value of above. */
  221.     Widget inner_widget;    /* Pointer to widget which actually contains
  222.                    text (may be same or different from
  223.                    this record).  */
  224.     XmTextLineTable line_table;
  225.     unsigned int table_size;
  226.     unsigned int table_index;
  227.  
  228. #ifdef _SGIMOTIF
  229.     _SG_XmTextExt    _SG_vendorExtension;
  230. #endif
  231.  
  232.     XtCallbackList  destination_callback;   /* Selection destination cb */
  233.     int          hsbar_scrolling;/* scroring using the horizontal scrollbar */
  234.  
  235.     OnTheSpotDataTW onthespot;  /* On the spot preedit style support. */
  236. } XmTextPart;
  237.  
  238. typedef struct _XmTextRec {
  239.     CorePart    core;
  240.     XmPrimitivePart primitive;
  241.     XmTextPart text;
  242. } XmTextRec;
  243.  
  244.  
  245. #ifdef __cplusplus
  246. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  247. #endif
  248.  
  249. #endif /* _XmTextP_h */
  250. /* DON't ADD STUFF AFTER THIS #endif */
  251.